import 'package:flutter/material.dart';
import 'package:qqmusic/widget/detailModel.dart';
import 'package:qqmusic/widget/jingxuan.dart';

class live extends StatefulWidget {
  live({Key key}) : super(key: key);

  @override
  State<live> createState() => _liveState();
}

class _liveState extends State<live> with TickerProviderStateMixin {
  List<Widget> tabs = [
    Text('听见'),
    Text('看见'),
    Text('交友'),
    Text('精选'),
  ];
  TabController controller;
  @override
  void initState() {
    super.initState();
    controller =
        TabController(length: tabs.length, vsync: this, initialIndex: 1);
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(horizontal: 15),
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          SafeArea(
            child: Container(
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Container(
                      width: MediaQuery.of(context).size.width * 0.7,
                      child: Theme(
                        data: ThemeData(
                            splashColor: Colors.transparent,
                            highlightColor: Colors.transparent),
                        child: TabBar(
                          labelPadding: EdgeInsets.symmetric(horizontal: 0),
                          tabs: tabs,
                          controller: controller,
                          labelColor: Color(0xff242525),
                          labelStyle: TextStyle(
                              fontSize: 18, fontWeight: FontWeight.w700),
                          unselectedLabelColor: Color(0xff252827),
                          indicatorSize: TabBarIndicatorSize.label,
                          unselectedLabelStyle: TextStyle(fontSize: 17),
                          indicatorColor: Color(0xff3be68e),
                          indicatorWeight: 5,
                        ),
                      )),
                  Icon(
                    Icons.add,
                    color: Color(0xff3be68e),
                  )
                ],
              ),
            ),
          ),
          Expanded(
              child: TabBarView(
            children: [
              detailModel(
                item: ['热门', '附近', '音乐', '  情感', '脱口秀', '萌新'],
              ),
              detailModel(
                item: ['热门', '音乐', '颜值', '才艺', '萌新', '嗨聊'],
              ),
              detailModel(
                item: ['热门', '附近', '萌新', '配对', '男神'],
              ),
              jingxuanTabview(),
            ],
            controller: controller,
          ))
        ],
      ),
    );
  }
}
